{include file="public/header" /}

<body class="ly_bg">

	
	<!--header start-->
    <header>
    	<div class="header">
        	<a href="javascript:history.go(-1);" class="fan"></a>
        	<h1>留言</h1>
        </div>
    </header>
    <!--header end-->
    
    <!--main start-->
    <ul class="ly_one">
        {volist name="list" id="vo"}
    	<li {if condition="$vo['user_id'] eq $uid"} class="rr" {/if} >
        	<img src="{$vo.user_head_img}" class="img">
            <div class="desc">{$vo.content}</div>
        </li>
        {/volist}
    </ul>
    <div class="ly_two">
    	<p>
        	<input id="content" type="text" class="txt" placeholder="说点什么">
            <input id="note" data-uid="{$to_uid}" type="button" class="btn" value="发送">
        </p>
    </div>
    <!--main end-->
    
    
    
</body>
<script>
    $("#note").click(function(){
        var uid = $(this).data('uid');
        var content = $('#content').val();
        if(!content){
            layer.msg('留言内容不能为空');
            return false;
        }
                // layer.alert(uid)
        $.post("{:url('index/Note/add')}", {'uid':uid,'content':content}, function (res) {
            if (res.code == 1) {
                layer.msg(res.msg, {time: 1000, icon: 1});
                location.reload();
            } else {
                layer.msg(res.msg, {time: 1000, icon: 2});
            }
        });

    })
</script>
</html>
